1. Technical Field
The present invention relates to data compression and decompression techniques and more particularly to a method of compressing and/or decompressing data using a prime number series.
2. Description of the Related Art
Increased bandwidth is needed for the transfer and storage of data. Increased use of data in real time, however, requires maximum transfer rates with minimum data loss due to processing errors. This requirement has given rise to increased applications involving data compression.
While many advances have been made in processing speed and data compression techniques, improvements in processing speed have greatly outpaced improvements related to data compression. In addition, the limited bandwidth available for transmitting data in modem communication systems has placed an ever increasing reliance on effective data compression techniques.
There are presently two general categories of data compression, namely, lossless and lossy. Lossless data compression techniques are designed to remove data redundancy without any data loss. On the contrary, lossy compression techniques remove both redundant data and data judged to be insignificant, according to predetermined criteria specific to the data application.
Although lossless compression techniques have become increasingly efficient, the amount of lossless compression possible in many applications is limited. For image compression, a maximum compression ratio of 2:1 or less is typically realized. Lossy data compression techniques are capable of substantially greater compression ratios in applications involving real time series representation of analog signals (such as speech or music) and two dimensional arrays representing images (still motion or video), wherein a portion of the data can be thrown away without noticeable errors during reconstruction. Still further compression benefits can be obtained by varying the degree of tolerance with respect to detectable errors in the reconstruction phase, depending upon the particular application.
One feature common to both lossless and lossy compression techniques is the restriction placed by available bandwidth. In most applications where data is compressed prior to transfer, the transmission time, generally a function of bandwidth, is the controlling factor. Once the data is received, decompression is typically a simple task due to the high speed of current processing units executing the inverse of the data compression routine. Consequently, a lot of time is spent transmitting and receiving data over limited bandwidths. Therefore, a system for compressing and decompressing data which utilizes minimum bandwidth while maximizing use of processor speed would be desirable.
Accordingly, it is a principle object of the invention to provide a method of compressing data which minimizes required bandwidth while fully utilizing modern processing capabilities.
It is another object of the invention to provide a method of decompressing data which minimizes bandwidth while maximizing use of processor speed.
It is a further object of the invention to provide a system for transmitting compressed data.
It is a still further object of the invention to provide a method of transmitting compressed data in real time.
In accordance with an object of the invention, a method of compressing data comprises: selecting at least one compression parameter to initialize a system having a data stream to be compressed, including a key parameter corresponding to a predetermined number of prime numbers to be used in the compression process; constructing a header containing the compression parameters; transferring the header to a compression buffer; transferring the data stream to the compression buffer, and compressing the contents of the compression buffer into a compressed data block based on the compression parameters. Compression of the data stream utilizes the prime number series and their exponents in order to provide lossless data compression with a high compression ratio. The resulting compressed data block and the header contain initialization parameters sufficient to reconstruct the data stream. As a result, the bandwidth required for data transmission is minimized while computation requirements are increased.
If the data to be compressed cannot be stored in the compression buffer, then the method of compressing further includes segmenting the data stream, prior to the step of transferring, into one or more data blocks according to the compression parameters; and assembling the one or more compressed data blocks, subsequent to the compressing step, into a compressed data stream.
In accordance with another object of the invention, a method of decompressing data comprises: retrieving at least one of compression parameter from a header associated with a compressed data block, including a key parameter corresponding to a predetermined number of prime numbers used to compress the data; transferring the compressed data block to an analysis buffer; and decompressing the contents of the analysis buffer into a decompressed data block according to the compression parameters. Retrieving compression parameters generated during the data compression phase allows lossless reconstruction of the original data without heavy requirements on bandwidth during transmission. If the data is in the form of a compressed data stream which was segmented prior to compression, then the method of decompression further comprises segmenting the compressed data into one or more compressed data blocks in accordance with the compression parameters retrieved from the header; and assembling one or more decompressed data blocks, resulting from the step of decompressing, into a data stream.
In accordance with another object of the invention, a system for transmitting compressed data comprises an encoder for retrieving data to be transmitted, a transmitting device for transmitting a header and a compressed data stream, a data receiving device for receiving the header and the compressed data stream, and a decoder for retrieving the header and the compressed data stream from the receiving device.
The encoder is configured to construct the header which contains a plurality of compression parameters, including a prime parameter corresponding to the number of prime numbers to be used in the compression algorithm, a limit parameter corresponding to a predetermined exponent value to be used in conjunction with the prime numbers, and a size parameter corresponding to the size of the largest set of bytes which may be compressed during each cycle.
The encoder is further configured to segment the data stream into one or more data blocks of predetermined length according to the size parameter, upon determining that the size of the data stream exceeds the size parameter, compress each of the one or more data blocks according to the compression parameters to form one or more compressed data blocks, generate an exponential parameter for each of the one or more compressed data blocks, and assemble the one or more compressed data blocks into a compressed data stream.
The decoder is configured to retrieve the compression parameters from the header, segment the compressed data stream into or more compressed data blocks according to the compression parameters received, decompress each of the one or more compressed data blocks to obtain one or more decompressed data blocks, and reassemble the one or more decompressed data blocks into the data originally retrieved by the encoder.
The present communication system provides reliable lossless data compression, minimizes bandwidth, and exploits the advantage of current processing units. The system may be used over a variety of communication networks including circuit switched, packet switched, wired, and wireless. Furthermore, the system may be used in real time using semiconductor devices to implement the compression and decompression algorithms.